<?php

defined('SYSPATH') OR die('No direct access allowed.');

class Inventarisasi_Controller extends Controller {

    public function __construct() {
        parent::__construct();
        $this->inventarisasi_model = new Inventarisasi_Model();
    }

    public function index() {
		if(!parent::_authenticate()) {
			return;
		}
		parent::_loadContent("Inventarisasi", 'inventarisasi_content');        
        $this->view->content->inventarisasi = $this->inventarisasi_model;
		$this->view->render(TRUE);
    }

    public function add_inventarisasi() {
        $this->tanggal = date("Y-m-d");
        $this->inventarisasi_model->insert_inventarisasi($this->tanggal,
																$this->input->post('keterangan'), 
                                                                $this->input->post('tipe'), 
                                                                $this->input->post('nominal'));
        url::redirect('inventarisasi');
    }

}
